import HomePage from "../pages/HomePage/HomePage.vue";
import PicturePage from "../pages/PicturePage/PicturePage.vue";
import UserLoginPage from "../pages/UserLoginPage/UserLoginPage.vue";
import UserRegisterPage from "../pages/UserRegisterPage/UserRegisterPage.vue";
import MessageDemo from "../pages/MessageDemo.vue";
import NotFoundPage from "../pages/NotFound/NotFoundPage.vue";
import SpacePage from "../pages/SpacePage/SpacePage.vue";
import UserInfoPage from "@/pages/UserInfoPage/UserInfoPage.vue";
import PictureProcessPage from "@/pages/PictureProcessPage/PictureProcessPage.vue";
import IntroduceView from "@/pages/PictureProcessPage/view/IntroduceView.vue";
import PictureDetailView from "@/pages/PicturePage/view/PictureDetailView.vue";
import SpaceDetailView from "@/pages/SpacePage/View/SpaceDetailView.vue";
import UserSpacesView from "@/pages/SpacePage/View/UserSpacesView.vue";
import IdPhotoView from "@/pages/PictureProcessPage/view/IdPhotoView.vue";

export const mainRoutes = [
    {
        path: '/',
        name: '首页',
        component: HomePage,
    },
    {
        path: '/picture',
        name: '素材库',
        component: PicturePage,
        children: [
            {
                path: '',
                name: '图片瀑布流',
                component: () => import('../pages/PicturePage/view/WaterfallView.vue')
            },
            {
                path: 'detail/:id',
                name: '图片详情',
                component: PictureDetailView
            },
            {
                path: 'upload',
                name: '上传图片',
                component: () => import('../pages/PicturePage/view/PictureUploadView.vue'),
                meta: {
                    requireLogin: true
                }
            }
        ]
    },
    {
        path: '/process',
        name: "图片处理",
        component:PictureProcessPage,
        children: [
            {
                path: "",
                name: "图片处理页介绍",
                component:IntroduceView,
            },
            {
                path: "idphoto",
                name:"证件照生成",
                component:IdPhotoView
            }
        ]
    },

    {
        path: "/space",
        name: "空间",
        component: SpacePage,
        children: [
            {
                path: "",
                name:"用户空间",
                component: UserSpacesView,
                meta: {
                    requireLogin: true
                }
            },
            {
                path: "detail/:id",
                name: '空间详情',
                component: SpaceDetailView,
                meta: {
                    requireLogin: true
                }
            }
        ],
    }

]


export const otherRoutes = [
    {
        path: '/login',
        name: 'userLogin',
        component: UserLoginPage
    },
    {
        path: '/register',
        name: 'userRegister',
        component: UserRegisterPage
    },
    {
        path: '/user/:id',
        name: 'userInfo',
        component: UserInfoPage
    },
    {
        path: '/message-demo',
        name: 'messageDemo',
        component: MessageDemo
    },
    {
        path: '/:pathMatch(.*)*',
        name: 'NotFound',
        component: NotFoundPage
    }
]